package com.njsf.utils;

import org.springframework.core.convert.converter.Converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateConverter implements Converter<String, Date> {
    @Override
    public Date convert(String s) {
        Date parse = null;
<<<<<<< HEAD
        if (s != null && !("".equals(s))){
=======
        if (!"".equals(s)){
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            try {
                parse = format.parse(s);
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
        return parse;
    }
}
